
import Vue from 'vue';
import Toast from './index.vue';

const showToast = function (type, message, time = 2000) {
  const ToastComponent = Vue.extend(Toast);
  const toastInstance = new ToastComponent();

  toastInstance.$mount();
  document.body.appendChild(toastInstance.$el);

  toastInstance.show(type, message, time);
};
Vue.prototype.$toast = showToast
export default showToast;